package cn.xaut.周赛.m226;

public class demo1742_2 {

    public int countBalls(int l, int h) {

        int[] sum = new int[50];
        int res = 0;
        for (int i = l; i <= h; i++) {
            int x = i, s = 0;
            while (x != 0) {
                s += x % 10;
                x /= 10;
            }
            sum[s] ++;
            res = Math.max(res, sum[s]);
        }
        return res;
    }
}
